﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Fis.Service.Forms
{
    public partial class LoginForm : BaseForm
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void bnCancel_Click(object sender, EventArgs e)
        {
            ViewResult = System.Windows.Forms.DialogResult.Cancel;
            Close();
        }

        private void bnOK_Click(object sender, EventArgs e)
        {
            if (!dxValidationProvider1.Validate())
            {
                return;
            }

            var param = new System.Collections.Hashtable();
            param["FUSERNAME"] = edName.EditValue;
            param["FPASSWORD"] = Agile.Engine.Utils.StringUtils.ToMD5(edPwd.EditValue.ToString());
            if (ViewProvider.ExecuteValidate(param))
            {
                ViewResult = System.Windows.Forms.DialogResult.OK;
                Close();
            }
        }
    }
}
